Option Strict On
Option Explicit On 

Public Class UConnection
    Inherits System.Windows.Forms.UserControl

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents btnConnection As System.Windows.Forms.Button
    Friend WithEvents txtName As System.Windows.Forms.TextBox
    Friend WithEvents lblName As System.Windows.Forms.Label
    Friend WithEvents grpConnection As System.Windows.Forms.GroupBox
    Friend WithEvents txtServerVersion As System.Windows.Forms.TextBox
    Friend WithEvents lblServerVersion As System.Windows.Forms.Label
    Friend WithEvents txtConnectionTimeout As System.Windows.Forms.TextBox
    Friend WithEvents lblConnectionTimeout As System.Windows.Forms.Label
    Friend WithEvents txtState As System.Windows.Forms.TextBox
    Friend WithEvents lblState As System.Windows.Forms.Label
    Friend WithEvents txtProvider As System.Windows.Forms.TextBox
    Friend WithEvents lblProvider As System.Windows.Forms.Label
    Friend WithEvents txtDataSource As System.Windows.Forms.TextBox
    Friend WithEvents lblDataSource As System.Windows.Forms.Label
    Friend WithEvents txtDatabase As System.Windows.Forms.TextBox
    Friend WithEvents lblDatabase As System.Windows.Forms.Label
    Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
    Friend WithEvents txtConnectionString As System.Windows.Forms.TextBox
    Friend WithEvents btnTest As System.Windows.Forms.Button
    Friend WithEvents gbConnectionString As System.Windows.Forms.GroupBox
    Friend WithEvents rbDataLinkProperties As System.Windows.Forms.RadioButton
    Friend WithEvents btnCopyToClipboard As System.Windows.Forms.Button
    Friend WithEvents rbConnectionString As System.Windows.Forms.RadioButton
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(UConnection))
        Me.btnConnection = New System.Windows.Forms.Button
        Me.txtName = New System.Windows.Forms.TextBox
        Me.lblName = New System.Windows.Forms.Label
        Me.grpConnection = New System.Windows.Forms.GroupBox
        Me.txtServerVersion = New System.Windows.Forms.TextBox
        Me.lblServerVersion = New System.Windows.Forms.Label
        Me.txtConnectionTimeout = New System.Windows.Forms.TextBox
        Me.lblConnectionTimeout = New System.Windows.Forms.Label
        Me.txtState = New System.Windows.Forms.TextBox
        Me.lblState = New System.Windows.Forms.Label
        Me.txtProvider = New System.Windows.Forms.TextBox
        Me.lblProvider = New System.Windows.Forms.Label
        Me.txtDataSource = New System.Windows.Forms.TextBox
        Me.lblDataSource = New System.Windows.Forms.Label
        Me.txtDatabase = New System.Windows.Forms.TextBox
        Me.lblDatabase = New System.Windows.Forms.Label
        Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider(Me.components)
        Me.txtConnectionString = New System.Windows.Forms.TextBox
        Me.btnTest = New System.Windows.Forms.Button
        Me.gbConnectionString = New System.Windows.Forms.GroupBox
        Me.btnCopyToClipboard = New System.Windows.Forms.Button
        Me.rbDataLinkProperties = New System.Windows.Forms.RadioButton
        Me.rbConnectionString = New System.Windows.Forms.RadioButton
        Me.grpConnection.SuspendLayout()
        CType(Me.ErrorProvider1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.gbConnectionString.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnConnection
        '
        Me.btnConnection.AccessibleDescription = Nothing
        Me.btnConnection.AccessibleName = Nothing
        resources.ApplyResources(Me.btnConnection, "btnConnection")
        Me.btnConnection.BackgroundImage = Nothing
        Me.btnConnection.Cursor = System.Windows.Forms.Cursors.Default
        Me.ErrorProvider1.SetError(Me.btnConnection, resources.GetString("btnConnection.Error"))
        Me.btnConnection.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.btnConnection, CType(resources.GetObject("btnConnection.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.btnConnection, CType(resources.GetObject("btnConnection.IconPadding"), Integer))
        Me.btnConnection.Name = "btnConnection"
        '
        'txtName
        '
        Me.txtName.AccessibleDescription = Nothing
        Me.txtName.AccessibleName = Nothing
        resources.ApplyResources(Me.txtName, "txtName")
        Me.txtName.BackgroundImage = Nothing
        Me.ErrorProvider1.SetError(Me.txtName, resources.GetString("txtName.Error"))
        Me.txtName.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtName, CType(resources.GetObject("txtName.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtName, CType(resources.GetObject("txtName.IconPadding"), Integer))
        Me.txtName.Name = "txtName"
        '
        'lblName
        '
        Me.lblName.AccessibleDescription = Nothing
        Me.lblName.AccessibleName = Nothing
        resources.ApplyResources(Me.lblName, "lblName")
        Me.ErrorProvider1.SetError(Me.lblName, resources.GetString("lblName.Error"))
        Me.lblName.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblName, CType(resources.GetObject("lblName.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblName, CType(resources.GetObject("lblName.IconPadding"), Integer))
        Me.lblName.Name = "lblName"
        '
        'grpConnection
        '
        Me.grpConnection.AccessibleDescription = Nothing
        Me.grpConnection.AccessibleName = Nothing
        resources.ApplyResources(Me.grpConnection, "grpConnection")
        Me.grpConnection.BackgroundImage = Nothing
        Me.grpConnection.Controls.Add(Me.txtServerVersion)
        Me.grpConnection.Controls.Add(Me.lblServerVersion)
        Me.grpConnection.Controls.Add(Me.txtConnectionTimeout)
        Me.grpConnection.Controls.Add(Me.lblConnectionTimeout)
        Me.grpConnection.Controls.Add(Me.txtState)
        Me.grpConnection.Controls.Add(Me.lblState)
        Me.grpConnection.Controls.Add(Me.txtProvider)
        Me.grpConnection.Controls.Add(Me.lblProvider)
        Me.grpConnection.Controls.Add(Me.txtDataSource)
        Me.grpConnection.Controls.Add(Me.lblDataSource)
        Me.grpConnection.Controls.Add(Me.txtDatabase)
        Me.grpConnection.Controls.Add(Me.lblDatabase)
        Me.ErrorProvider1.SetError(Me.grpConnection, resources.GetString("grpConnection.Error"))
        Me.grpConnection.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.grpConnection, CType(resources.GetObject("grpConnection.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.grpConnection, CType(resources.GetObject("grpConnection.IconPadding"), Integer))
        Me.grpConnection.Name = "grpConnection"
        Me.grpConnection.TabStop = False
        '
        'txtServerVersion
        '
        Me.txtServerVersion.AccessibleDescription = Nothing
        Me.txtServerVersion.AccessibleName = Nothing
        resources.ApplyResources(Me.txtServerVersion, "txtServerVersion")
        Me.txtServerVersion.BackColor = System.Drawing.SystemColors.Control
        Me.txtServerVersion.BackgroundImage = Nothing
        Me.txtServerVersion.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.ErrorProvider1.SetError(Me.txtServerVersion, resources.GetString("txtServerVersion.Error"))
        Me.txtServerVersion.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtServerVersion, CType(resources.GetObject("txtServerVersion.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtServerVersion, CType(resources.GetObject("txtServerVersion.IconPadding"), Integer))
        Me.txtServerVersion.Name = "txtServerVersion"
        Me.txtServerVersion.ReadOnly = True
        Me.txtServerVersion.TabStop = False
        '
        'lblServerVersion
        '
        Me.lblServerVersion.AccessibleDescription = Nothing
        Me.lblServerVersion.AccessibleName = Nothing
        resources.ApplyResources(Me.lblServerVersion, "lblServerVersion")
        Me.ErrorProvider1.SetError(Me.lblServerVersion, resources.GetString("lblServerVersion.Error"))
        Me.lblServerVersion.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblServerVersion, CType(resources.GetObject("lblServerVersion.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblServerVersion, CType(resources.GetObject("lblServerVersion.IconPadding"), Integer))
        Me.lblServerVersion.Name = "lblServerVersion"
        '
        'txtConnectionTimeout
        '
        Me.txtConnectionTimeout.AccessibleDescription = Nothing
        Me.txtConnectionTimeout.AccessibleName = Nothing
        resources.ApplyResources(Me.txtConnectionTimeout, "txtConnectionTimeout")
        Me.txtConnectionTimeout.BackColor = System.Drawing.SystemColors.Control
        Me.txtConnectionTimeout.BackgroundImage = Nothing
        Me.txtConnectionTimeout.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.ErrorProvider1.SetError(Me.txtConnectionTimeout, resources.GetString("txtConnectionTimeout.Error"))
        Me.txtConnectionTimeout.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtConnectionTimeout, CType(resources.GetObject("txtConnectionTimeout.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtConnectionTimeout, CType(resources.GetObject("txtConnectionTimeout.IconPadding"), Integer))
        Me.txtConnectionTimeout.Name = "txtConnectionTimeout"
        Me.txtConnectionTimeout.ReadOnly = True
        Me.txtConnectionTimeout.TabStop = False
        '
        'lblConnectionTimeout
        '
        Me.lblConnectionTimeout.AccessibleDescription = Nothing
        Me.lblConnectionTimeout.AccessibleName = Nothing
        resources.ApplyResources(Me.lblConnectionTimeout, "lblConnectionTimeout")
        Me.ErrorProvider1.SetError(Me.lblConnectionTimeout, resources.GetString("lblConnectionTimeout.Error"))
        Me.lblConnectionTimeout.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblConnectionTimeout, CType(resources.GetObject("lblConnectionTimeout.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblConnectionTimeout, CType(resources.GetObject("lblConnectionTimeout.IconPadding"), Integer))
        Me.lblConnectionTimeout.Name = "lblConnectionTimeout"
        '
        'txtState
        '
        Me.txtState.AccessibleDescription = Nothing
        Me.txtState.AccessibleName = Nothing
        resources.ApplyResources(Me.txtState, "txtState")
        Me.txtState.BackColor = System.Drawing.SystemColors.Control
        Me.txtState.BackgroundImage = Nothing
        Me.txtState.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.ErrorProvider1.SetError(Me.txtState, resources.GetString("txtState.Error"))
        Me.txtState.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtState, CType(resources.GetObject("txtState.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtState, CType(resources.GetObject("txtState.IconPadding"), Integer))
        Me.txtState.Name = "txtState"
        Me.txtState.ReadOnly = True
        Me.txtState.TabStop = False
        '
        'lblState
        '
        Me.lblState.AccessibleDescription = Nothing
        Me.lblState.AccessibleName = Nothing
        resources.ApplyResources(Me.lblState, "lblState")
        Me.ErrorProvider1.SetError(Me.lblState, resources.GetString("lblState.Error"))
        Me.lblState.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblState, CType(resources.GetObject("lblState.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblState, CType(resources.GetObject("lblState.IconPadding"), Integer))
        Me.lblState.Name = "lblState"
        '
        'txtProvider
        '
        Me.txtProvider.AccessibleDescription = Nothing
        Me.txtProvider.AccessibleName = Nothing
        resources.ApplyResources(Me.txtProvider, "txtProvider")
        Me.txtProvider.BackColor = System.Drawing.SystemColors.Control
        Me.txtProvider.BackgroundImage = Nothing
        Me.txtProvider.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.ErrorProvider1.SetError(Me.txtProvider, resources.GetString("txtProvider.Error"))
        Me.txtProvider.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtProvider, CType(resources.GetObject("txtProvider.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtProvider, CType(resources.GetObject("txtProvider.IconPadding"), Integer))
        Me.txtProvider.Name = "txtProvider"
        Me.txtProvider.ReadOnly = True
        Me.txtProvider.TabStop = False
        '
        'lblProvider
        '
        Me.lblProvider.AccessibleDescription = Nothing
        Me.lblProvider.AccessibleName = Nothing
        resources.ApplyResources(Me.lblProvider, "lblProvider")
        Me.ErrorProvider1.SetError(Me.lblProvider, resources.GetString("lblProvider.Error"))
        Me.lblProvider.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblProvider, CType(resources.GetObject("lblProvider.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblProvider, CType(resources.GetObject("lblProvider.IconPadding"), Integer))
        Me.lblProvider.Name = "lblProvider"
        '
        'txtDataSource
        '
        Me.txtDataSource.AccessibleDescription = Nothing
        Me.txtDataSource.AccessibleName = Nothing
        resources.ApplyResources(Me.txtDataSource, "txtDataSource")
        Me.txtDataSource.BackColor = System.Drawing.SystemColors.Control
        Me.txtDataSource.BackgroundImage = Nothing
        Me.txtDataSource.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.ErrorProvider1.SetError(Me.txtDataSource, resources.GetString("txtDataSource.Error"))
        Me.txtDataSource.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtDataSource, CType(resources.GetObject("txtDataSource.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtDataSource, CType(resources.GetObject("txtDataSource.IconPadding"), Integer))
        Me.txtDataSource.Name = "txtDataSource"
        Me.txtDataSource.ReadOnly = True
        Me.txtDataSource.TabStop = False
        '
        'lblDataSource
        '
        Me.lblDataSource.AccessibleDescription = Nothing
        Me.lblDataSource.AccessibleName = Nothing
        resources.ApplyResources(Me.lblDataSource, "lblDataSource")
        Me.ErrorProvider1.SetError(Me.lblDataSource, resources.GetString("lblDataSource.Error"))
        Me.lblDataSource.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblDataSource, CType(resources.GetObject("lblDataSource.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblDataSource, CType(resources.GetObject("lblDataSource.IconPadding"), Integer))
        Me.lblDataSource.Name = "lblDataSource"
        '
        'txtDatabase
        '
        Me.txtDatabase.AccessibleDescription = Nothing
        Me.txtDatabase.AccessibleName = Nothing
        resources.ApplyResources(Me.txtDatabase, "txtDatabase")
        Me.txtDatabase.BackColor = System.Drawing.SystemColors.Control
        Me.txtDatabase.BackgroundImage = Nothing
        Me.txtDatabase.BorderStyle = System.Windows.Forms.BorderStyle.None
        Me.ErrorProvider1.SetError(Me.txtDatabase, resources.GetString("txtDatabase.Error"))
        Me.txtDatabase.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtDatabase, CType(resources.GetObject("txtDatabase.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtDatabase, CType(resources.GetObject("txtDatabase.IconPadding"), Integer))
        Me.txtDatabase.Name = "txtDatabase"
        Me.txtDatabase.ReadOnly = True
        Me.txtDatabase.TabStop = False
        '
        'lblDatabase
        '
        Me.lblDatabase.AccessibleDescription = Nothing
        Me.lblDatabase.AccessibleName = Nothing
        resources.ApplyResources(Me.lblDatabase, "lblDatabase")
        Me.ErrorProvider1.SetError(Me.lblDatabase, resources.GetString("lblDatabase.Error"))
        Me.lblDatabase.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.lblDatabase, CType(resources.GetObject("lblDatabase.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.lblDatabase, CType(resources.GetObject("lblDatabase.IconPadding"), Integer))
        Me.lblDatabase.Name = "lblDatabase"
        '
        'ErrorProvider1
        '
        Me.ErrorProvider1.ContainerControl = Me
        resources.ApplyResources(Me.ErrorProvider1, "ErrorProvider1")
        '
        'txtConnectionString
        '
        Me.txtConnectionString.AccessibleDescription = Nothing
        Me.txtConnectionString.AccessibleName = Nothing
        resources.ApplyResources(Me.txtConnectionString, "txtConnectionString")
        Me.txtConnectionString.BackgroundImage = Nothing
        Me.ErrorProvider1.SetError(Me.txtConnectionString, resources.GetString("txtConnectionString.Error"))
        Me.txtConnectionString.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.txtConnectionString, CType(resources.GetObject("txtConnectionString.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.txtConnectionString, CType(resources.GetObject("txtConnectionString.IconPadding"), Integer))
        Me.txtConnectionString.Name = "txtConnectionString"
        '
        'btnTest
        '
        Me.btnTest.AccessibleDescription = Nothing
        Me.btnTest.AccessibleName = Nothing
        resources.ApplyResources(Me.btnTest, "btnTest")
        Me.btnTest.BackgroundImage = Nothing
        Me.btnTest.Cursor = System.Windows.Forms.Cursors.Default
        Me.ErrorProvider1.SetError(Me.btnTest, resources.GetString("btnTest.Error"))
        Me.btnTest.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.btnTest, CType(resources.GetObject("btnTest.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.btnTest, CType(resources.GetObject("btnTest.IconPadding"), Integer))
        Me.btnTest.Name = "btnTest"
        '
        'gbConnectionString
        '
        Me.gbConnectionString.AccessibleDescription = Nothing
        Me.gbConnectionString.AccessibleName = Nothing
        resources.ApplyResources(Me.gbConnectionString, "gbConnectionString")
        Me.gbConnectionString.BackgroundImage = Nothing
        Me.gbConnectionString.Controls.Add(Me.btnCopyToClipboard)
        Me.gbConnectionString.Controls.Add(Me.txtConnectionString)
        Me.gbConnectionString.Controls.Add(Me.btnTest)
        Me.ErrorProvider1.SetError(Me.gbConnectionString, resources.GetString("gbConnectionString.Error"))
        Me.gbConnectionString.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.gbConnectionString, CType(resources.GetObject("gbConnectionString.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.gbConnectionString, CType(resources.GetObject("gbConnectionString.IconPadding"), Integer))
        Me.gbConnectionString.Name = "gbConnectionString"
        Me.gbConnectionString.TabStop = False
        '
        'btnCopyToClipboard
        '
        Me.btnCopyToClipboard.AccessibleDescription = Nothing
        Me.btnCopyToClipboard.AccessibleName = Nothing
        resources.ApplyResources(Me.btnCopyToClipboard, "btnCopyToClipboard")
        Me.btnCopyToClipboard.BackgroundImage = Nothing
        Me.btnCopyToClipboard.Cursor = System.Windows.Forms.Cursors.Default
        Me.ErrorProvider1.SetError(Me.btnCopyToClipboard, resources.GetString("btnCopyToClipboard.Error"))
        Me.btnCopyToClipboard.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.btnCopyToClipboard, CType(resources.GetObject("btnCopyToClipboard.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.btnCopyToClipboard, CType(resources.GetObject("btnCopyToClipboard.IconPadding"), Integer))
        Me.btnCopyToClipboard.Name = "btnCopyToClipboard"
        '
        'rbDataLinkProperties
        '
        Me.rbDataLinkProperties.AccessibleDescription = Nothing
        Me.rbDataLinkProperties.AccessibleName = Nothing
        resources.ApplyResources(Me.rbDataLinkProperties, "rbDataLinkProperties")
        Me.rbDataLinkProperties.BackgroundImage = Nothing
        Me.rbDataLinkProperties.Checked = True
        Me.ErrorProvider1.SetError(Me.rbDataLinkProperties, resources.GetString("rbDataLinkProperties.Error"))
        Me.rbDataLinkProperties.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.rbDataLinkProperties, CType(resources.GetObject("rbDataLinkProperties.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.rbDataLinkProperties, CType(resources.GetObject("rbDataLinkProperties.IconPadding"), Integer))
        Me.rbDataLinkProperties.Name = "rbDataLinkProperties"
        Me.rbDataLinkProperties.TabStop = True
        '
        'rbConnectionString
        '
        Me.rbConnectionString.AccessibleDescription = Nothing
        Me.rbConnectionString.AccessibleName = Nothing
        resources.ApplyResources(Me.rbConnectionString, "rbConnectionString")
        Me.rbConnectionString.BackgroundImage = Nothing
        Me.ErrorProvider1.SetError(Me.rbConnectionString, resources.GetString("rbConnectionString.Error"))
        Me.rbConnectionString.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me.rbConnectionString, CType(resources.GetObject("rbConnectionString.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me.rbConnectionString, CType(resources.GetObject("rbConnectionString.IconPadding"), Integer))
        Me.rbConnectionString.Name = "rbConnectionString"
        '
        'UConnection
        '
        Me.AccessibleDescription = Nothing
        Me.AccessibleName = Nothing
        resources.ApplyResources(Me, "$this")
        Me.BackgroundImage = Nothing
        Me.Controls.Add(Me.rbConnectionString)
        Me.Controls.Add(Me.rbDataLinkProperties)
        Me.Controls.Add(Me.gbConnectionString)
        Me.Controls.Add(Me.btnConnection)
        Me.Controls.Add(Me.txtName)
        Me.Controls.Add(Me.lblName)
        Me.Controls.Add(Me.grpConnection)
        Me.ErrorProvider1.SetError(Me, resources.GetString("$this.Error"))
        Me.Font = Nothing
        Me.ErrorProvider1.SetIconAlignment(Me, CType(resources.GetObject("$this.IconAlignment"), System.Windows.Forms.ErrorIconAlignment))
        Me.ErrorProvider1.SetIconPadding(Me, CType(resources.GetObject("$this.IconPadding"), Integer))
        Me.Name = "UConnection"
        Me.grpConnection.ResumeLayout(False)
        Me.grpConnection.PerformLayout()
        CType(Me.ErrorProvider1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.gbConnectionString.ResumeLayout(False)
        Me.gbConnectionString.PerformLayout()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

#End Region

    Private oleDbConnection As OleDb.OleDbConnection

    Public Event ValueChanged As EventHandler

    Private Sub UConnection_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddHandler txtName.TextChanged, AddressOf OnValueChanged
        AddHandler rbDataLinkProperties.CheckedChanged, AddressOf OnValueChanged
        AddHandler rbConnectionString.CheckedChanged, AddressOf OnValueChanged
        AddHandler txtConnectionString.TextChanged, AddressOf OnValueChanged
    End Sub

    Private Sub txtName_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtName.Validated
        If txtName.Text = "" Then
            ErrorProvider1.SetError(txtName, "Connection Name is required.")
        Else
            ErrorProvider1.SetError(txtName, "")
        End If
    End Sub
    Private Sub btnConnection_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnConnection.Click
        Application.DoEvents()
        Cursor.Current = Cursors.WaitCursor
        '----------------------------------
        Dim MSDASCObj As New MSDASC.DataLinks
        Dim cn As New ADODB.Connection
        Try
            cn.ConnectionString = oleDbConnection.ConnectionString
            If MSDASCObj.PromptEdit(CObj(cn)) Then
                oleDbConnection.ConnectionString = cn.ConnectionString
                Test(btnConnection)
                OnValueChanged(Me, New EventArgs)
            End If
        Catch ex As System.Runtime.InteropServices.COMException
            cn = CType(MSDASCObj.PromptNew(), ADODB.Connection)
            If Not cn Is Nothing Then
                oleDbConnection.ConnectionString = cn.ConnectionString
                Test(btnConnection)
                OnValueChanged(Me, New EventArgs)
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
        cn = Nothing
        '----------------------------------
        Cursor.Current = Cursors.Default
    End Sub
    Private Sub btnCopyToClipboard_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopyToClipboard.Click
        On Error Resume Next
        Clipboard.SetText(oleDbConnection.ConnectionString)
    End Sub
    Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
        Try
            oleDbConnection.ConnectionString = txtConnectionString.Text
            Test(btnTest)

            Dim str As String = ErrorProvider1.GetError(btnTest)
            If str = "" Then
                MsgBox("Test connection succeeded")
            Else
                MsgBox(str, MsgBoxStyle.Critical)
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
    Private Sub rbConnectionString_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbConnectionString.CheckedChanged
        gbConnectionString.Enabled = rbConnectionString.Checked
        If Not oleDbConnection Is Nothing Then
            oleDbConnection.ConnectionString = ""
            Test(btnTest)
        End If
    End Sub
    Private Sub rbDataLinkProperties_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbDataLinkProperties.CheckedChanged
        btnConnection.Enabled = rbDataLinkProperties.Checked
        If Not oleDbConnection Is Nothing Then
            oleDbConnection.ConnectionString = ""
            Test(btnConnection)
        End If
    End Sub

    Private Sub Test(ByVal ctrl As Control)
        txtProvider.Text = oleDbConnection.Provider
        txtDataSource.Text = oleDbConnection.DataSource
        txtDatabase.Text = oleDbConnection.Database
        txtConnectionTimeout.Text = oleDbConnection.ConnectionTimeout.ToString & " sec"
        If oleDbConnection.ConnectionString = "" Then
            txtServerVersion.Text = ""
        Else
            Application.DoEvents()
            Cursor.Current = Cursors.WaitCursor
            '----------------------------------
            Try
                oleDbConnection.Open()
                txtServerVersion.Text = oleDbConnection.ServerVersion
                ErrorProvider1.SetError(ctrl, "")
                oleDbConnection.Close()
            Catch ex As Exception
                oleDbConnection.Close()
                txtServerVersion.Text = "<Unkhown>"
                ErrorProvider1.SetError(ctrl, ex.Message)
            End Try
            '----------------------------------
            Cursor.Current = Cursors.Default
        End If
        txtState.Text = oleDbConnection.State.ToString
    End Sub

    Protected Sub OnValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        RaiseEvent ValueChanged(Me, New EventArgs)
    End Sub

    Public Sub Read(ByVal connection As Model10.Connection)
        txtName.Text = connection.Name
        oleDbConnection = New OleDb.OleDbConnection(connection.ConnectionString)
        Test(btnConnection)
    End Sub
    Public Sub Write(ByVal connection As Model10.Connection)
        If rbConnectionString.Checked Then oleDbConnection.ConnectionString = txtConnectionString.Text

        connection.Name = txtName.Text
        connection.ConnectionString = oleDbConnection.ConnectionString
    End Sub
End Class